package main

import (
	"api-gate/global"
	__ "api-gate/proto"
	"api-gate/router"
	"github.com/gin-gonic/gin"
	"google.golang.org/grpc"
	"google.golang.org/grpc/credentials/insecure"
)

func main() {
	VideoRpc()
	r := gin.Default()
	router.LordRouter(r)
	r.Run()
}

func VideoRpc() {
	conn, _ := grpc.NewClient("127.0.0.1:9999", grpc.WithTransportCredentials(insecure.NewCredentials()))
	//if err != nil {
	//	log.Fatalf("did not connect: %v", err)
	//}
	//defer conn.Close()
	global.VideoRpc = __.NewVideoClient(conn)
}
